package org.nf.trading.controller.app.product;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nf.trading.controller.BaseController;
import org.nf.trading.dao.ProductTypeMapper;
import org.nf.trading.entity.ProductType;
import org.nf.trading.vo.ResultVO;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequiredArgsConstructor
@Slf4j
@CrossOrigin
@RequestMapping("/api/productType")
public class ProductTypeController extends BaseController {
    private final ProductTypeMapper productTypeMapper;

    @GetMapping("/selectAll")
    public ResultVO selectAll(){
        List<ProductType> productTypes = productTypeMapper.selectAll();
        return success(productTypes);
    }
}
